<style>
    .layui-form {
        padding: 15px 0px
    }

    .layui-form label {
        text-align: justify;
        text-align-last: justify
    }

    .layui-form-radio {
        margin: 0px 0px 0 0;
        padding-right: 0px;
        line-height: 10px;
    }

    .layui-form-radio > i {
        font-size: 16px;
        margin-right: 5px
    }

    .zxd_status {
        margin-right: 8px
    }

    .zxd_img {
        width: 80px;
        max-height: 150px;
    }
</style>

<div class="modal-body">


    <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" close="true">
            <span aria-hidden="true">×</span>
        </button>
        <h4 class="modal-title">
            <span class="fa fa-legal"></span>&nbsp;兑换详情
        </h4>
    </div>

    <form class="form-horizontal layui-form content_main">

        <div class="form-group">
            <label class="col-sm-2 control-label">所属景区</label>
            <div class="col-sm-4 content_div">
                {$detail.colony_name}
            </div>
            <label class="col-sm-2 control-label">核销码</label>
            <div class="col-sm-4 content_div">
                {$detail.order_sn}
            </div>
        </div>

        <div class="form-group">
            <label class="col-sm-2 control-label">粉丝昵称</label>
            <div class="col-sm-4 content_div">
                {$detail.nickname}
            </div>
            <label class="col-sm-2 control-label">联系电话</label>
            <div class="col-sm-4 content_div">
                {$detail.mobile}
            </div>
        </div>

        <div class="form-group">
            <label class="col-sm-2 control-label">所属身份</label>
            <div class="col-sm-4 content_div">
                {$detail.type}
            </div>
            <label class="col-sm-2 control-label">名称</label>
            <div class="col-sm-4 content_div">
                {$detail.name}
            </div>
        </div>



        <div class="form-group">
            <label class="col-sm-2 control-label">兑换产品</label>
            <div class="col-sm-4 content_div">
                {$detail.title}
            </div>

            <label class="col-sm-2 control-label">消费积分</label>
            <div class="col-sm-4 content_div">
                {$detail.integral}
            </div>
        </div>

        <div class="form-group">
            <label class="col-sm-2 control-label">产品缩略图</label>
            <div class="col-sm-10 content_div">
                <img class="zxd_img" src="{$detail.thumb}">
            </div>
        </div>

        <div class="form-group">
            <label class="col-sm-2 control-label">当前状态</label>
            <div class="col-sm-4 content_div">
                {$detail.status}
            </div>

            <label class="col-sm-2 control-label">兑换时间</label>
            <div class="col-sm-4 content_div">
                {$detail.addtime|date="Y-m-d H:i:s",###}
            </div>
        </div>

        <div class="form-group">
            <label class="col-sm-2 control-label">更改状态</label>
            <div class="col-sm-10 content_div">
<!--                <label class="zxd_status"><input name="status" value="1" type="radio" disabled>待核销</label>-->
                <label class="zxd_status"><input name="status" value="2" type="radio">已核销</label>
                <label class="zxd_status"><input name="status" value="3" type="radio">驳回</label>
            </div>
        </div>


    </form>
</div>

<div class="modal-footer">
    <button type="button" class="layui-btn layui-btn-primary js_cancel" close="true">关闭</button>
    <button type="button" class="layui-btn js_confirm">修改</button>
    <!--    <button type="button" class="btn btn-primary btn-sm" id="newsave" _event="add">保存</button>-->
</div>


<script>

    layui.use(['form', 'layedit', 'tree', 'util'], function () {
        var form = layui.form
            , layer = layui.layer;
        var layedit = layui.layedit;
        var tree = layui.tree;
        var util = layui.util;

        $(".js_confirm").click(function () {
            var id = "{$detail.id}";
            var status = $('input[name="status"]:checked').val();
            $.ajax({
                type: "post",
                url: "{:URL('community/Exchange/updateStatus')}",
                data: {id: id,status:status},
                dataType: "json",
                success: function (data) {
                    if (data.code == 0) {
                        $(".js_cancel").click();
                        window.location.href = "{:URL('community/Exchange/order')}";
                    } else {
                        layer.alert(data.msg);
                    }
                }
            });


        });

        layui.form.render('select');
        form.render();


    });
</script>

